﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:props="clr-namespace:ScrumFactory.Windows.Properties"
                    xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
                    xmlns:SF_Converters="clr-namespace:ScrumFactory.Windows.Helpers.Converters;assembly=ScrumFactory.Windows.Helpers">

    <SF_Converters:LocalizeConverter x:Key="LocalizeConverter" />
    <SF_Converters:ImageSourceConverter x:Key="ImageSourceConverter"/>



    <DrawingImage x:Key="ShowTaskThumbImage" PresentationOptions:Freeze="True">
        <DrawingImage.Drawing>
            <ImageDrawing ImageSource="/Images/Toolbar/postItView.png" Rect="0,0,24,24" />
        </DrawingImage.Drawing>
    </DrawingImage>

    <Style x:Key="HasArtifactImage" TargetType="{x:Type Image}" PresentationOptions:Freeze="True">
        <Setter Property="Stretch" Value="Uniform"/>
        <Setter Property="Source" Value="/Images/Toolbar/link.png"/>
        <Setter Property="Width" Value="16"/>
        <Setter Property="Height" Value="16"/>
        <Setter Property="Visibility" Value="Collapsed"/>
        <Style.Triggers>            
            <DataTrigger Binding="{Binding}" Value="True">
                <Setter Property="Visibility" Value="Visible"/>
            </DataTrigger>            
        </Style.Triggers>
    </Style>

    <Style x:Key="BacklogItemStatusImage" TargetType="{x:Type Image}" PresentationOptions:Freeze="True">
        <Setter Property="Stretch" Value="Uniform"/>
        <Setter Property="Width" Value="16"/>
        <Setter Property="Height" Value="16"/>
        <Setter Property="ToolTip" Value="{Binding ., Converter={StaticResource LocalizeConverter}}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding}"  Value="0">
                <Setter Property="Source" Value="/Images/BacklogItemStatus/Item.png"/>                
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="1">
                <Setter Property="Source" Value="/Images/BacklogItemStatus/ItemWorking.png"/>                
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="2">
                <Setter Property="Source" Value="/Images/BacklogItemStatus/ItemDone.png"/>                
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="3">
                <Setter Property="Source" Value="/Images/BacklogItemStatus/ItemCanceled.png"/>                
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="ConstraintGroupImage" TargetType="Image" >
        <Setter Property="Source" Value="{Binding ., Converter={StaticResource ImageSourceConverter}, ConverterParameter='/Images/ConstraintGroups/{0}.png'}"/>
        <Setter Property="Stretch" Value="Uniform"/>        
        <Setter Property="Width" Value="32"/>
        <Setter Property="Height" Value="32"/>
    </Style>

    <Style x:Key="IssueImage" TargetType="{x:Type Image}">
        <Setter Property="Stretch" Value="Uniform"/>
        <Setter Property="Width" Value="16"/>
        <Setter Property="Height" Value="16"/>        
        <Style.Triggers>
            <DataTrigger Binding="{Binding}"  Value="1">
                <Setter Property="Source" Value="/Images/TaskTypes/bug2.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="2">
                <Setter Property="Source" Value="/Images/TaskTypes/improvement.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="3">
                <Setter Property="Source" Value="/Images/RiskIndicators/redsquare.png"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="EventTypeImage" TargetType="{x:Type Image}">
        <Setter Property="Stretch" Value="Uniform"/>
        <Setter Property="Width" Value="16"/>
        <Setter Property="Height" Value="16"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding}"  Value="0">
                <Setter Property="Source" Value="/Images/ToolBar/startProject.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="1">
                <Setter Property="Source" Value="/Images/ToolBar/sprint.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="2">
                <Setter Property="Source" Value="/Images/ToolBar/closeProject.png"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>


    <Style x:Key="RiskIndicatorImage" TargetType="{x:Type Image}">
        <Setter Property="Stretch" Value="Uniform"/>
        <Setter Property="Width" Value="32"/>
        <Setter Property="Height" Value="32"/>
        <Setter Property="ToolTip" Value="{Binding ., Converter={StaticResource LocalizeConverter}}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding}"  Value="0">
                <Setter Property="Source" Value="/Images/RiskIndicators/GreenSquare.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="1">
                <Setter Property="Source" Value="/Images/RiskIndicators/BlueSquare.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="2">
                <Setter Property="Source" Value="/Images/RiskIndicators/YellowSquare.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="3">
                <Setter Property="Source" Value="/Images/RiskIndicators/RedSquare.png"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="PriorityIndicatorImage" TargetType="{x:Type Image}">
        <Setter Property="Stretch" Value="Uniform"/>
        <Setter Property="Width" Value="32"/>
        <Setter Property="Height" Value="32"/>
        <Setter Property="ToolTip" Value="{Binding ., Converter={StaticResource LocalizeConverter}}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding}"  Value="0">
                <Setter Property="Source" Value="/Images/RiskIndicators/GreenSquare.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="1">
                <Setter Property="Source" Value="/Images/RiskIndicators/BlueSquare.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="2">
                <Setter Property="Source" Value="/Images/RiskIndicators/YellowSquare.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="3">
                <Setter Property="Source" Value="/Images/RiskIndicators/RedSquare.png"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>



    <Style x:Key="ProposalStatusImage" TargetType="{x:Type Image}">
        <Setter Property="Stretch" Value="Uniform"/>
        <Setter Property="Width" Value="32"/>
        <Setter Property="Height" Value="32"/>
        <Setter Property="ToolTip" Value="{Binding ., Converter={StaticResource LocalizeConverter}}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding}"  Value="0">
                <Setter Property="Source" Value="/Images/ProposalStatus/proposal.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="1">
                <Setter Property="Source" Value="/Images/ProposalStatus/proposalApproved.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="2">
                <Setter Property="Source" Value="/Images/ProposalStatus/proposalRejected.png"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="WhiteBoardTitleImage" TargetType="{x:Type Image}">
        <Setter Property="Stretch" Value="None"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding}"  Value="0">
                <Setter Property="Source" Value="{x:Static props:ImageResources.TODO_PANEL_TITLE}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="1">
                <Setter Property="Source" Value="{x:Static props:ImageResources.WORKING_PANEL_TITLE}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="2">
                <Setter Property="Source" Value="{x:Static props:ImageResources.DONE_PANEL_TITLE}"/>
            </DataTrigger>            
        </Style.Triggers>
    </Style>

    <Style x:Key="TaskTypeImage" TargetType="{x:Type Image}">
        <Setter Property="Stretch" Value="Fill"/>
        <Setter Property="Width" Value="16"/>
        <Setter Property="Height" Value="16"/>
        <Setter Property="ToolTip" Value="{Binding ., Converter={StaticResource LocalizeConverter}}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding}"  Value="0">
                <Setter Property="Source" Value="/Images/TaskTypes/improvement.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="1">
                <Setter Property="Source" Value="/Images/TaskTypes/postit.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="2">
                <Setter Property="Source" Value="/Images/TaskTypes/postit.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="3">
                <Setter Property="Source" Value="/Images/TaskTypes/impediment.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="4">
                <Setter Property="Source" Value="/Images/TaskTypes/bug.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="5">
                <Setter Property="Source" Value="/Images/TaskTypes/bug2.png"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="TaskStatusImage" TargetType="{x:Type Image}">        
        <Setter Property="Stretch" Value="Fill"/>
        <Setter Property="Width" Value="16"/>
        <Setter Property="Height" Value="16"/>                
        <Style.Triggers>
            <DataTrigger Binding="{Binding}"  Value="2">
                <Setter Property="Source" Value="/Images/TaskStatus/done.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="3">
                <Setter Property="Source" Value="/Images/TaskStatus/canceled.png"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="IsTaskCanceledImage" TargetType="{x:Type Image}">
        <Setter Property="Image.Visibility" Value="Collapsed"/>
        <Setter Property="Stretch" Value="Uniform"/>
        <Setter Property="Width" Value="16"/>
        <Setter Property="Height" Value="16"/>
        <Setter Property="ToolTip" Value="{x:Static props:Resources.Task_canceled}"/>
        <Setter Property="Source" Value="/Images/TaskStatus/canceled.png"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding}"  Value="true">
                <Setter Property="Image.Visibility" Value="Visible"/>
            </DataTrigger>                        
        </Style.Triggers>
    </Style>

    <Style x:Key="TaskTypeOnPostItImage" TargetType="{x:Type Image}" BasedOn="{StaticResource TaskTypeImage}">
        <Setter Property="Visibility" Value="Collapsed"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding}"  Value="0">
                <Setter Property="Visibility" Value="Visible"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="4">
                <Setter Property="Visibility" Value="Visible"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="5">
                <Setter Property="Visibility" Value="Visible"/>
            </DataTrigger>            
        </Style.Triggers>
    </Style>
    
    

    <Style x:Key="PermissionSetImage" TargetType="{x:Type Image}">
        <Setter Property="Stretch" Value="Uniform"/>
        <Setter Property="ToolTip" Value="{Binding ., Converter={StaticResource LocalizeConverter}}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding}"  Value="0">
                <Setter Property="Source" Value="/Images/PermissionSets/ScrumMaster.gif"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="1">
                <Setter Property="Source" Value="/Images/PermissionSets/Team.gif"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="2">
                <Setter Property="Source" Value="/Images/PermissionSets/ProductOwner.gif"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="3">
                <Setter Property="Source" Value="/Images/PermissionSets/CommercialGuy.gif"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="BacklogItemOccurrenceImage" TargetType="{x:Type Image}">                        
        <Setter Property="ToolTip" Value="{Binding ., Converter={StaticResource LocalizeConverter}}"/>        
        <Setter Property="Width" Value="16"/>
        <Setter Property="Height" Value="16"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding}"  Value="0">
                <Setter Property="Source" Value="/Images/BacklogItemOccurrenceConstraint/planning.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="1">
                <Setter Property="Source" Value="{x:Null}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="2">
                <Setter Property="Source" Value="/Images/BacklogItemOccurrenceConstraint/delivery.png"/>
            </DataTrigger>            
        </Style.Triggers>
    </Style>



    <Style x:Key="ProjectStatusImage" TargetType="{x:Type Image}">        
        <Setter Property="Stretch" Value="None"/>
        <Setter Property="Width" Value="32"/>
        <Setter Property="Height" Value="32"/>
        <Setter Property="ToolTip" Value="{Binding ., Converter={StaticResource LocalizeConverter}}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding}"  Value="0">
                <Setter Property="Source" Value="/Images/ProjectStatus/prjOportunity.png"/>
            </DataTrigger>            
            <DataTrigger Binding="{Binding}"  Value="1">
                <Setter Property="Source" Value="/Images/ProjectStatus/prjApproved.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="2">
                <Setter Property="Source" Value="/Images/ProjectStatus/prjRejected.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="3">
                <Setter Property="Source" Value="/Images/ProjectStatus/prjRunning.png"/>
            </DataTrigger>            
            <DataTrigger Binding="{Binding}"  Value="4">
                <Setter Property="Source" Value="/Images/ProjectStatus/prjDone.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding}"  Value="5">
                <Setter Property="Source" Value="/Images/ProjectStatus/prjSupport.png"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>


    <PathGeometry x:Key="NoneMemberAllocation">
        <PathFigure StartPoint="8 10" IsClosed="True" IsFilled="True" >
            <ArcSegment
                Size="4 4" Point="8 14"
                  IsLargeArc="True"                
                SweepDirection="Clockwise" />            
        </PathFigure>
    </PathGeometry>


    <PathGeometry x:Key="QuarterMemberAllocation">
        <PathFigure StartPoint="12 0" IsClosed="True">
            <ArcSegment
                Size="12 12"
                Point="24 12"                                                    
                SweepDirection="Clockwise" />
            <LineSegment Point="12 12" />
        </PathFigure>
    </PathGeometry>

    <PathGeometry x:Key="HalfMemberAllocation">
        <PathFigure StartPoint="12 0" IsClosed="True">
            <ArcSegment
                Size="12 12"
                Point="24 12"                                                    
                SweepDirection="Clockwise" />
            <ArcSegment
                Size="12 12"
                Point="12 24"                                                    
                SweepDirection="Clockwise" />
        </PathFigure>
    </PathGeometry>

    <PathGeometry x:Key="ThreeQuarterMemberAllocation">
        <PathFigure StartPoint="12 0" IsClosed="True">
            <ArcSegment
                Size="12 12"
                Point="24 12"                                                    
                SweepDirection="Clockwise" />
            <ArcSegment
                Size="12 12"
                Point="12 24"                                                    
                SweepDirection="Clockwise" />
            <ArcSegment
                Size="12 12"
                Point="0 12"                                                    
                SweepDirection="Clockwise" />
            <LineSegment Point="12 12" />
        </PathFigure>
    </PathGeometry>

    <PathGeometry x:Key="FullMemberAllocation">
        <PathFigure StartPoint="12 0" IsClosed="True">
            <ArcSegment
                Size="12 12"
                Point="24 12"                                                    
                SweepDirection="Clockwise" />
            <ArcSegment
                Size="12 12"
                Point="12 24"                                                    
                SweepDirection="Clockwise" />
            <ArcSegment
                Size="12 12"
                Point="0 12"                                                    
                SweepDirection="Clockwise" />
            <ArcSegment
                Size="12 12"
                Point="12 0"                                                    
                SweepDirection="Clockwise" />
        </PathFigure>
    </PathGeometry>
    
    <Style x:Key="DayAllocationPath" TargetType="{x:Type Path}">
        <Setter Property="Width" Value="30"/>
        <Setter Property="Height" Value="30"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="StrokeLineJoin" Value="Round"/>
        <Setter Property="Effect">
            <Setter.Value>
                <DropShadowEffect  ShadowDepth="2" Opacity="0.5"/>
            </Setter.Value>
        </Setter>
        <Setter Property="Fill">
            <Setter.Value>
                <SolidColorBrush Color="{StaticResource Red3Color}"/>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <DataTrigger Binding="{Binding .}" Value="0">
                <Setter Property="Path.Data" Value="{StaticResource NoneMemberAllocation}"/>
                <Setter Property="Path.Fill">
                    <Setter.Value>
                        <SolidColorBrush Color="Transparent"/>
                    </Setter.Value>                    
                </Setter>
                <Setter Property="Path.ToolTip" Value="{x:Static props:Resources.dayNull_allocation}"/>                
                <!--<Setter Property="Path.Visibility" Value="Collapsed"/>-->
            </DataTrigger>
            <DataTrigger Binding="{Binding .}" Value="1">
                <Setter Property="Path.Data" Value="{StaticResource QuarterMemberAllocation}"/>
                <Setter Property="Path.ToolTip" Value="{x:Static props:Resources.day14_allocation}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding .}" Value="2">
                <Setter Property="Path.Data" Value="{StaticResource HalfMemberAllocation}"/>
                <Setter Property="Path.ToolTip" Value="{x:Static props:Resources.day12_allocation}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding .}" Value="3">
                <Setter Property="Path.Data" Value="{StaticResource ThreeQuarterMemberAllocation}"/>
                <Setter Property="Path.ToolTip" Value="{x:Static props:Resources.day34_allocation}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding .}" Value="4">
                <Setter Property="Path.Data" Value="{StaticResource FullMemberAllocation}"/>
                <Setter Property="Path.ToolTip" Value="{x:Static props:Resources.day44_allocation}"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="AllocationToolTipTextBlock" TargetType="TextBlock">
        <Style.Triggers>
            <DataTrigger Binding="{Binding .}" Value="1">
                <Setter Property="Text" Value="{x:Static props:Resources.day14_allocation}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding .}" Value="2">
                <Setter Property="Text" Value="{x:Static props:Resources.day12_allocation}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding .}" Value="3">
                <Setter Property="Text" Value="{x:Static props:Resources.day34_allocation}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding .}" Value="4">
                <Setter Property="Text" Value="{x:Static props:Resources.day44_allocation}"/>
            </DataTrigger>
        </Style.Triggers>

    </Style>

    <Storyboard x:Key="ClockStoryboard" PresentationOptions:Freeze="True">
        <DoubleAnimation                
                Storyboard.TargetProperty="(Path.RenderTransform).(RotateTransform.Angle)"
                From="0"
                To="360"
                Duration="0:0:1"
                RepeatBehavior="Forever" />
    </Storyboard>
    
    <Style x:Key="DownArrowPath" TargetType="Path">
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Fill">
            <Setter.Value>
                <SolidColorBrush Color="{StaticResource Green2Color}"/>
            </Setter.Value>
        </Setter>
        <Setter Property="Stroke">
            <Setter.Value>
                <SolidColorBrush Color="{StaticResource Green4Color}"/>
            </Setter.Value>
        </Setter>
        <Setter Property="Data">
            <Setter.Value>
                <PathGeometry>
                    <PathFigure StartPoint="0 0"  IsClosed="True">                        
                        <LineSegment Point="12 0" />
                        <LineSegment Point="6 8" />
                    </PathFigure>
                </PathGeometry>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Margin" Value="0,1,0,0"/>
                <Setter Property="Effect" Value="{x:Null}"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="False">
                <Setter Property="Effect">
                    <Setter.Value>
                        <DropShadowEffect ShadowDepth="1" Opacity="0.3"/>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="ClockPath" TargetType="Path">
        <Setter Property="Fill" Value="{StaticResource TrackClockBrush}"/>
        <Setter Property="Data">
            <Setter.Value>
                <PathGeometry>
                    <PathFigure StartPoint="12 0"  IsClosed="True">
                        <ArcSegment Size="12 12" Point="24 12" SweepDirection="Clockwise" />
                        <LineSegment Point="12 12" />
                    </PathFigure>
                </PathGeometry>
            </Setter.Value>
        </Setter>
        <Setter Property="RenderTransform">
            <Setter.Value>
                <RotateTransform Angle="0" CenterX="12" CenterY="12"/>
            </Setter.Value>
        </Setter>       
    </Style>

    <Style x:Key="ClockPath_VM" TargetType="Path" BasedOn="{StaticResource ClockPath}">      
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsTracking}" Value="True">
                <DataTrigger.EnterActions>
                    <BeginStoryboard x:Name="clockStory" Storyboard="{StaticResource ClockStoryboard}"/>
                </DataTrigger.EnterActions>
                <DataTrigger.ExitActions>
                    <StopStoryboard BeginStoryboardName="clockStory"/>
                </DataTrigger.ExitActions>
            </DataTrigger>
            <DataTrigger Binding="{Binding IsTracking}" Value="False">
                <Setter Property="Path.Visibility" Value="Hidden"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>






</ResourceDictionary>